import redis
from time import sleep
address = []

ip_set = set()
def ip_log():
        try:
                for a in address:
                        client = redis.Redis(host=a, port=6379)
                        res = client.client_list()      
                        for r in res:
                                ip_port = r.get("addr", "")
                                if ":" in ip_port:
                                        ip = ip_port.split(":")[0]
                                        ip_set.add(ip)
        
                for i in ip_set:
                        print(i)
        
        except Exception as e:
                print(e)

ip_log()